﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAL;
using Model;

namespace BLL
{
    public class SOP_CompanyRegisterBLL
    {
        #region 私有变量
        private static SOP_CompanyRegisterDAL _dal;
        private static SOP_CompanyRegisterDAL dal
        {
            get
            {
                if (_dal == null)
                {
                    _dal = new SOP_CompanyRegisterDAL();
                }
                return _dal;
            }
        }
        #endregion

        #region 注册
        public static int Register(SOP_CompanyRegister model, out int UserId)
        {
            return dal.Register(model, out UserId);
        }
        #endregion

        #region 登录
        /// <summary>
        /// 登录
        /// </summary>
        /// <param name="Mobile"></param>
        /// <param name="Password"></param>
        /// <returns></returns>
        public static SOP_CompanyRegister Login(string Mobile, string Password, string IPAddress, string UserAgent)
        {
            return dal.Login(Mobile, Password, IPAddress, UserAgent);
        }
        #endregion

        #region 获取列表
        public static SOP_CompanyRegister GetUserInfo(int UserId)
        {
            return dal.GetUserInfo(UserId);
        }
        #endregion

        #region 修改密码
        /// <summary>
        /// 修改密码
        /// </summary>
        /// <param name="Mobile"></param>
        /// <param name="Password"></param>
        /// <param name="IPAddress"></param>
        /// <param name="UserAgent"></param>
        /// <returns></returns>
        public static int UpdatePasswordByMobile(string Mobile, string Password, string IPAddress, string UserAgent, out string UserName, out int UserId)
        {
            return dal.UpdatePasswordByMobile(Mobile, Password, IPAddress, UserAgent, out UserName, out UserId);
        }
        #endregion

        #region 获取云管理登录密码
        public static string GetPasswordByUserName(string UserName, string StaffCode)
        {
            return dal.GetPasswordByUserName(UserName, StaffCode);
        }
        #endregion
    }
}
